package com.bike.bikeserver.controller.backend;


import com.bike.bikeserver.common.core.domain.CommonResult;
import com.bike.bikeserver.domain.vo.ModelTestImgVo;
import com.bike.bikeserver.service.IModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ZZX
 * @since 2023-08-07
 */
@RestController
@RequestMapping("back/model")
public class BackModelController
{
    @Autowired
    IModelService modelService;

    /**
     * 获取所有模型
     *
     * @return
     */
    @GetMapping("getModelList")
    public CommonResult getModelList()
    {
        return modelService.getModelList();
    }

    /**
     * 根据某个标准查找模型
     *
     * @param sth
     * @param info
     * @return
     */
    @GetMapping("getModelLikeSth")
    public CommonResult getModelLikeSth(@RequestParam("sth") String sth, @RequestParam("info") String info)
    {
        return modelService.getModelLikeSth(sth, info);
    }

    /**
     * 测试模型
     *
     * @param modelTestImgVo
     * @return
     */
    @PostMapping("testModel")
    public CommonResult testModel(@RequestBody ModelTestImgVo modelTestImgVo)
    {
        return modelService.testModel(modelTestImgVo);
    }

}

